package com.pinapel.aixml;

import java.io.BufferedReader;
import java.io.File;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import javax.xml.parsers.*;
import java.io.FileInputStream;

import org.xml.sax.*;
import org.xml.sax.helpers.*;
import org.w3c.dom.*;
import javax.xml.parsers.ParserConfigurationException;

import com.pinapel.aixml.models.xml.DomModel;
import com.pinapel.aixml.models.xml.NodeID;
import com.pinapel.aixml.models.xml.XMLParser;

import java.io.*;
import java.util.ArrayList;

public class MainTest {

	
	/**
	 * @param args
	 * @throws ParserConfigurationException 
	 */
	public static void main(String[] args) throws Exception {
				
		/*
		 * Test class for DomModel and DomNode
		 */
		
		String fileName = "xmltest4.xml";
		
		FileInputStream iStream = new FileInputStream(new File(fileName));
		
		XMLParser parser = new XMLParser();
		
		DomModel dM = parser.parseToDom(iStream);
		
		int[] test={0};
		dM.getNode(new NodeID(test)).addAttr("pañuelo", "blanco");
		dM.getNode(new NodeID(test)).addAttr("pañuelo", "negro");
		
		System.out.println(dM.getNode(new NodeID(test)).getTextVersion());
    }
}
